package br.com.ufrn.aipetro.ga.domain.entity.device.maintenance;

import br.com.ufrn.aipetro.ga.domain.entity.interfaces.AbstractModel;


/**
 * <p>
 * Representa todos os tipos de  manuten?�es que podem ser realizadas nos dispositivos (equipamentos).
 * Ex: Controladoes, atuadores, sensores, etc.
 * </p>
 * 
 * <p>
 * <b>Atributos</b>: <br>
 * <b>name</b> - Tipo da manuten?�o. Ex: Preventiva, Preditiva, Corretiva  <br>
 * </p>
 * 
 * @author Lucas Vasconcelos
 * @author Andre Quintiliano
 * 
 */

public class MaintenanceType extends AbstractModel  {
	
	public static final String ID_TB_MAINTENANCE_TYPE_PROPERTY = "idTbMaintenanceType";
	public static final String NAME_TYPE_PROPERTY = "name";
	
	private Integer idTbMaintenanceType;
	private String name;
	
	public MaintenanceType() {
		
	}
	
	public MaintenanceType(String name) {
		this.name = name;
	}

	/**
	 * @return the idTbMaintenanceType
	 */
	
	public Integer getIdTbMaintenanceType() {
		return idTbMaintenanceType;
	}
	
	/**
	 * @return the name
	 */
	
	public String getName() {
		return name;
	}
	
	/**
	 * @param idTbMaintenanceType the idTbMaintenanceType to set
	 */
	
	public void setIdTbMaintenanceType(Integer idTbMaintenanceType) {
		Integer oldIdTbMaintenanceType = this.idTbMaintenanceType;
		this.idTbMaintenanceType = idTbMaintenanceType;
		
		firePropertyChange(ID_TB_MAINTENANCE_TYPE_PROPERTY, oldIdTbMaintenanceType, idTbMaintenanceType);
	}

	/**
	 * @param name the name to set
	 */
	
	public void setName(String name) {
		
		String oldName = this.name;
		this.name = name;
		
		firePropertyChange(NAME_TYPE_PROPERTY, oldName, name);
	}
	
	public String toString() {
		return this.name;
	}

}